package com.vincent.dao;

import com.vincent.common.enums.CacheEnum;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by vincent on 15-1-2.
 */
@Repository("hotSearchDao")
public class HotSearchDao {
    @Resource
    private HotSearchMapper hotSearchMapper;
    @Cacheable(value = CacheEnum.HOT_SEARCH)
    public List<String> selectTop(int num){
        return hotSearchMapper.selectTopNum(num);
    }

    @CacheEvict(value = CacheEnum.HOT_SEARCH,allEntries = true)
    public void clearCache(){

    }
}